<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
    <!-- Loading Bootstrap -->
    <link href="/static/admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
    <!-- Loading Flat UI -->
    <link href="/static/admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
    <link href="/static/admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
    <link rel="shortcut icon" href="/static/admin/Flat/img/favicon.ico">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="dist/js/vendor/html5shiv.js"></script>
    <script src="dist/js/vendor/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<form action="/admin/article/{$articleData.aid}" method="post" enctype="multipart/form-data">
    <input type="hidden" name="_method" value="PUT" >
    <div class="alert alert-success">编辑文章</div>
    <div class="form-group">
        <label for="title">文章标题</label>
        <input required id="title" class="form-control" type="text" placeholder="请输入分类名称" name="title"
               value="{$articleData.title}">
    </div>
    <div class="form-group">
        <label for="author">作者</label>
        <input required id="author" class="form-control" type="text" placeholder="请输入分类名称" name="author"
               value="{$articleData.author}">
    </div>
    <div class="form-group">
        <label for="cateid">所属分类</label>
        <select required id="cateid" name="cateid" class="form-control">
            <option value="">请选择</option>
            {volist name="cateDatas" id="cate"}
            {if condition="($cate['cid'] == $articleData['cateid'])"}
            <option value="{$cate.cid}" selected>{$cate.cname}</option>
            {else /}
            <option value="{$cate.cid}">{$cate.cname}</option>
            {/if}
            {/volist}
        </select>
    </div>

    <div class="form-group">
        <label for="thumb">缩略图</label>
        <input id="thumb" type="file" name="thumb">
        <div>
            <code>已选图片缩略图：</code>
            <img height="50px" src="{$articleData.thumb}">
        </div>
    </div>

    <div>
        <label>文章标签</label>
        <br/>
        {volist name="tagDatas" id="tag"}
            <label class="checkbox checkbox-inline">
                <input class="custom-checkbox" name="tagArt[]" type="checkbox"
                       {volist name="articleTags" id="articleTag" }
                       {if condition="($tag['tid'] == $articleTag)"}
                       checked
                       {/if}
                       {/volist}
                       data-toggle="checkbox" value="{$tag.tid}">
                <span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
                {$tag.tname}
            </label>
        {/volist}
    </div>
    <div class="form-group">
        <label for="zhaiyao">文章摘要</label>
        <textarea required id="zhaiyao" name="zhaiyao" rows="5" cols="" class="form-control"
                  placeholder="文章摘要">{$articleData.zhaiyao}</textarea>
    </div>
    <div class="form-group">
        <label for="keywords">文章关键字</label>
        <textarea required id="keywords" name="keywords" rows="5" cols="" class="form-control"
                  placeholder="请输入文章关键字">{$articleData.keywords}</textarea>
    </div>
    <div class="form-group">
        <label for="describe">文章描述</label>
        <textarea required id="describe" name="describe" rows="5" cols="" class="form-control"
                  placeholder="请输入文章描述">{$articleData.describe}</textarea>
    </div>
    <div class="form-group">
        <label for="editor">文章正文</label>
        <script type="text/javascript" charset="utf-8" src="/static/admin/ueditor/ueditor.config.js"></script>
        <script type="text/javascript" charset="utf-8" src="/static/admin/ueditor/ueditor.all.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="/static/admin/ueditor/lang/zh-cn/zh-cn.js"></script>
        <script id="editor" type="text/plain" name="content" style="width:100%;height:500px;"></script>
        <script >
        var ue = UE.getEditor('editor');
        //对编辑器的操作最好在编辑器ready之后再做
        ue.ready(function () {
            //设置编辑器的内容
            ue.setContent('{$articleData.content}');
        });
        </script>
    </div>
    <button class="btn btn-primary btn-block" type="submit"> 确定</button>
</form>
</body>
</html>
